﻿using System;
namespace CXedu.Model
{
	///<summary>
	///
	///</summary>
	public class Category : ModelBase<int?>
	{
		#region 成员字段
		
		private int? _enable = null;
		private string _name = String.Empty;
		private int _pid = default(Int32);
		private double? _sort = null;
		
		#endregion
		
		#region 构造方法
		
		public Category() { }
		
		#endregion
		
		#region 成员方法
		
		public override int GetHashCode()
		{
			System.Text.StringBuilder sb = new System.Text.StringBuilder();
			sb.Append(this.GetType().FullName);
			sb.Append(_enable);
			sb.Append(_name);
			sb.Append(_pid);
			sb.Append(_sort);
			return sb.ToString().GetHashCode();
		}
		
		#endregion
		
		#region 成员属性
		
		///<summary>
		///是否启用
		///</summary>
		public int? Enable
		{
			get
			{
				return _enable;
			}
			set
			{
				_enable = value;
			}
		}
		///<summary>
		///分类名称
		///</summary>
		public string Name
		{
			get
			{
				return _name;
			}
			set
			{
				_name = value;
			}
		}
		///<summary>
		///分类父级ID
		///</summary>
		public int Pid
		{
			get
			{
				return _pid;
			}
			set
			{
				_pid = value;
			}
		}
		///<summary>
		///分类排序
		///</summary>
		public double? Sort
		{
			get
			{
				return _sort;
			}
			set
			{
				_sort = value;
			}
		}
		
        /// <summary>
        /// 自定义查询条件
        /// </summary>
        public string CustomWhere { get; set; }
		
		#endregion
	}
		
	public static class CategoryHash
	{
		public const string TopNum = "TopNum";
		public const string OrderField = "OrderField";
		public const string OrderDirection = "OrderDirection";
		public const string Enable = "Enable";
		public const string Id = "Id";
		public const string Name = "Name";
		public const string Pid = "Pid";
		public const string Sort = "Sort";
		
        public const string CustomWhere = "CustomWhere";
	}
}